/**
 * 
 */
package sailing.managers.impl;

import java.util.List;

import sailing.dao.CashVoucherDao;
import sailing.entity.CashVoucher;
import sailing.managers.CashVoucherManager;
import cjlite.annotations.Inject;
import cjlite.utils.Lists;

/**
 * @author simon
 * 
 */
public class CashVoucherManagerImpl implements CashVoucherManager {

	private List<CashVoucher> cashAccountList = Lists.newArrayList();

	@Inject
	private CashVoucherDao cDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see sailing.managers.CustomerManager#save(sailing.entity.Customer)
	 */
	@Override
	public String save(CashVoucher c) {
		if (cDao.save(c)) {
			return "";
		}
		return "添加失败！";
	}


	@Override
	public List<CashVoucher> getAllCashAccountList() {
		List<CashVoucher> clist = cDao.getAllList();
		if (clist == null) {
			return Lists.newArrayList();
		}
		cashAccountList.clear();
		cashAccountList.addAll(clist);
		return clist;
	}

	@Override
	public void delete(CashVoucher cc) {
		boolean result = cDao.delete(cc);
	}

	@Override
	public String update(CashVoucher editCustomer) {
		if (cDao.update(editCustomer)) {
			return "";
		}
		return "保存数据失败！";
	}


	@Override
	public boolean saveList(List<CashVoucher> dataList) {
		return false;
	}

}
